package com.qzsoft.zhjd.asphalt.modules.asphaltdatasieve.controller;

import java.util.List;
import java.util.Map;

import com.qzsoft.zhjd.asphalt.modules.asphaltdatasieve.dto.AsphaltDataSievingDto;
import com.qzsoft.zhjd.asphalt.modules.asphaltdatasieve.dto.ProduceSievePassRateDto;
import com.qzsoft.zhjd.asphalt.modules.asphaltdatasieve.service.AsphaltDataSieveService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qzsoft.jeemis.common.utils.Result;
import com.qzsoft.zhjd.common.utils.ResultUtils;

/**
 * @ClassName AsphaltDataSieveController
 * @Description 筛孔控制器
 * @author linhuawei
 * @since 2021-12-04
 */
@RestController
@RequestMapping("/api/asphaltDataSieve")
public class AsphaltDataSieveController {

    @Autowired
    private AsphaltDataSieveService asphaltDataSieveService;

    /**
     * @Title page
     * @Description 获取筛孔分页数据
     * @param params 查询条件
     * @return 筛孔分页数据
     */
    @RequiresPermissions("api:asphaltData:productmoninter")
    @GetMapping("/page")
    public Result<IPage<AsphaltDataSievingDto>> page(@RequestParam Map<String, Object> params) {
        IPage<AsphaltDataSievingDto> page = asphaltDataSieveService.pageDto(params);
        return ResultUtils.ok(page);
    }


    /**
     * @Title produceSievePassRate
     * @Description 关键筛孔通过率
     * @param params 查询条件
     * @return 关键筛孔通过率
     */
    @RequiresPermissions("api:asphaltDataSieve:produceSievePassRate")
    @GetMapping("/produceSievePassRate")
    public Result<List<ProduceSievePassRateDto>> produceSievePassRate(@RequestParam Map<String, Object> params) {
        List<ProduceSievePassRateDto> list = asphaltDataSieveService.produceSievePassRate(params);
        return ResultUtils.ok(list);
    }

//    /**
//     * @Title produceSievePassRate
//     * @Description 关键筛孔通过率
//     * @param params 查询条件
//     * @return 关键筛孔通过率
//     */
//    @GetMapping("/produceSievePassRatePage")
//    public Result<IPage<ProduceSievePassRateDto>> produceSievePassRatePage(@RequestParam Map<String, Object> params) {
//        IPage<ProduceSievePassRateDto> page = asphaltDataSieveService.produceSievePassRatePage(params);
//        return ResultUtils.ok(page);
//    }

}
